<template>
    <view>
        <view class="cashier_box_2">
            <view class="cardsale-conter">
                <view class="shop-message">
                    <view class="shop-lt">
                        <view class="lt-profile">
                            <image :src="memberList.headPicture || 'https://yiyue-store-applet.oss-cn-shenzhen.aliyuncs.com/profile-hai.png'" mode="" />
                        </view>
                        <view class="lt-name">
                            {{ memberList.userName }}
                            <text class="lt-shopvip" v-if="memberList.storeVip">门店VIP</text>
                            <view class="lt-phone">{{ memberList.mobile }}</view>
                        </view>
                    </view>
                    <view class="hr"></view>
                    <view class="shop-rl">
                        <view class="rl-vipbox">
                            <view class="rl-vip">VIP会员</view>
                            <view class="rl-remaining">余额：¥{{ memberList.balance }}</view>
                        </view>
                        <image @tap="ElasticFrameClick" class="replace" src="https://yiyue-store-applet.oss-cn-shenzhen.aliyuncs.com/replace.png"></image>
                    </view>
                </view>
                <view></view>
            </view>
        </view>
        <view>
            <calculator input_label="new-input_label" number-block="new-number-block" />
        </view>
    </view>
</template>

<script>
import calculator from '@/component/calculator/index';
// pagesc/confirmpay/confirmpay.js
import _request from '../../utils/request';
import { toDecimal2 } from '../../utils/util.js';
export default {
    components: {
        calculator
    },
    data() {
        return {
            memberList: {
                headPicture: '',
                storeVip: '',
                mobile: '',
                balance: ''
            },
            type: 1,
            showModal: false,
            userObj: {},
            nickName: '',
            servelist: [],
            rightserve: [],
            curNav: '',
            rightconterts: '',
            selectedServerList: [],
            // 已选服务项目
            rentalmoney: 0,
            btnIndex: 0,
            showGoods: false,
            type: 1,
            showModal: false,
            ajxtrue: false,
            ishint2: false,
            phone2: '',
            memberList: {},
            memberid: '',
            selGoods: [],
            serviceName: '',
            isDisabled: true
        };
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(o) {
        console.log(o);

        if (o.memberid) {
            this.setData({
                memberid: o.memberid
            });
        }
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
        // 获取用户个人信息
        // _request.get('/cashier/getStoreServices', {
        //   shopId: wx.getStorageSync('shopId'),
        // }).then(res =>{
        //   let data = res.data.data
        //   let rightconterts = data[0]?.name
        //   let rightserve = data[0]?.services
        //   let curNav = data[0]?.id
        //   console.log(data)
        //   if(this.data.type == '3'){
        //     data.forEach(i =>{
        //       i.services.forEach( k=>{
        //         this.data.selGoods.forEach(j=>{
        //           if(k.id === j){
        //             k.isactivity = true
        //           }
        //         })
        //       })
        //     })
        //   }
        //   this.setData({
        //     curNav: curNav,
        //     rightconterts: rightconterts,
        //     rightserve: rightserve,
        //     servelist: data.map((item) => {
        //       let obj = {};
        //       if (item.list) {
        //         obj.servicename = item.title;
        //         obj.isactivity = false;
        //         obj.isgroup = true;
        //         obj.maxPrice = item.maxPrice;
        //         obj.price = item.price;
        //         obj.serviceOptions = item.list.map((v) => {
        //           let objs = {};
        //           objs.isactivity = !!v.isactivity;
        //           objs.price = v.newPrice;
        //           objs.name = v.serviceName;
        //           objs.icon = v.path;
        //           objs.categoryId = v.categoryId;
        //           objs.id = v.id;
        //           objs.sds = [];
        //           return objs;
        //         });
        //         return obj;
        //       } else {
        //         item.services.map((v) => {
        //           v.isactivity = !!v.isactivity;
        //           v.isgroup = true
        //           return v;
        //         });
        //         return item;
        //       }
        //     }),
        //   });
        //   let msg = []
        //   this.data.servelist.forEach(i=>{
        //     i.services.forEach(j=>{
        //       if(j.isactivity){
        //         msg.push(j)
        //       }
        //     })
        //   })
        //   this.setData({
        //     selectedServerList: msg
        //   })
        // })
    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {},
    methods: {
        ElasticFrameClick() {
            this.setData({
                showModal: true
            });
        }
    }
};
</script>
<style>
/* pagesc/confirmpay/confirmpay.wxss */
page {
    background: #f1f1f1;
}
.new-input_label {
    color: #e94a18;
    font-size: 24rpx;
    margin-right: 5rpx;
}

.new-number-block {
    display: flex;
    color: #e94a18;
    font-size: 24rpx;
    font-family: Adobe Heiti Std R;
    font-weight: normal;
}
.cashier_box_2 {
    width: 750rpx;
    height: 240rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20rpx;
    background: #ffffff;
}
.shop-message {
    height: 140rpx;
    background: #ffffff;
    box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(242, 93, 3, 0.16);
    border-radius: 10rpx;
    display: flex;
    align-items: center;
    width: 670rpx;
}

.shop-lt {
    width: 314rpx;
    height: 80rpx;
    display: flex;
}
.hr {
    width: 2rpx;
    height: 130rpx;
    background: linear-gradient(0deg, #ffffff, #e94a18, #ffffff);
}

.lt-profile {
    width: 80rpx;
    height: 80rpx;
    margin-left: 20rpx;
}
.lt-profile image {
    width: 80rpx;
    height: 80rpx;
}
/* 567 */
.lt-name {
    font-size: 28rpx;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #333333;
    margin-left: 13rpx;
}

.lt-shopvip {
    width: 100rpx;
    height: 32rpx;
    background-color: rgba(233, 74, 24, 0.1);
    border-radius: 4rpx;
    font-size: 24rpx;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #e94a18;
    padding: 0rpx 10rpx;
}

.lt-phone {
    font-size: 28rpx;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #333333;
    margin-top: 10rpx;
}

.shop-rl {
    width: 354rpx;
    display: flex;
    align-items: center;
    height: 80rpx;
    justify-content: space-between;
}

.rl-vip {
    font-size: 28rpx;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #333333;
}

.rl-remaining {
    font-size: 28rpx;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #333333;
    margin-top: 10rpx;
}

.rl-vipbox {
    margin-left: 28rpx;
}

.replace {
    width: 54rpx;
    height: 54rpx;
    margin-right: 15rpx;
}
</style>
